package com.xpc.controller.vo;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.api.ApiController;
import com.baomidou.mybatisplus.extension.api.R;
//import com.xpc.controller.utils.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xpc.mapper.StudentInfoMapper;
import com.xpc.pojo.vo.StudentInfo;
import com.xpc.service.IStudentInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Project：UniversityGradeAdministrationSystem
 * Date：2022/5/24
 * Time：19:31
 * Description：TODO
 *
 * @author 南北辰的键盘
 * @version 1.0
 */
@RestController
@RequestMapping("studentsInfo")
public class StudentInfoController extends ApiController{
    @Autowired
    private IStudentInfoService studentInfoService;
    @Autowired
    private StudentInfoMapper studentInfoMapper;

    /**
     * 获取所有学生信息
     * @param page
     * @param studentInfo
     * @return
     */
//    @GetMapping("/page{currentPage}")
//    public R selectAll(@PathVariable int currentPage){
    @GetMapping
    public R selectAll(Page<StudentInfo> page, StudentInfo studentInfo){


        List<StudentInfo> studentInfoList = this.studentInfoMapper.selectStudentInfo();
        return success(studentInfoList);

//        return success(this.studentInfoService.page(page,new QueryWrapper<>(studentInfo)));

//        return success(this.studentInfoService.getPage(currentPage,10));

//        return success(this.studentInfoMapper.selectStudentInfo(page,new QueryWrapper<>(studentInfo)));

    }




}
